/**
 * @file memory.h
 *       carl_pan (1586975697@qq.com)
 * @brief 
 * @version 0.1
 * @date 2023-04-03
 * 
 * @copyright Copyright (c) 2023
 * 
 */

#ifndef _MALLOC_H
#define _MALLOC_H

#include <stdio.h>
#include <stdint.h>


/* memory pools define */
typedef enum
{
	SRAMIN = 0,
	SRAMCCM, /* CPU access only */
	POOL_NUM,
}e_memoryPool;


#define mymalloc(memx, size) myMalloc(memx, size)
#define myfree(memx, ptr) myFree(memx, ptr)
#define myrealloc(memx, ptr, size) myRealloc(memx, ptr, size)
#define mymem_init(memx) mymemInit(memx)

void *myMalloc(uint8_t memx, uint32_t size);
void myFree(uint8_t memx,void *ptr);
void *myRealloc(uint8_t memx, void *ptr, uint32_t size);

#define mymemInit(memx) memInit(memx, #memx)
void memInit(uint8_t memx, const char *poolName);
uint8_t mymemUsage(uint8_t memx);


#endif


